#pragma once
#include "stdafx.h"

////////////////////////////////////////////////////////////////////////////////
// Class name: InputClass
////////////////////////////////////////////////////////////////////////////////

class Component;

class InputClass : public Component
{
private:
	InputClass(const InputClass&);

public:
	typedef boost::shared_ptr<InputClass> sPtr;
	InputClass();
	~InputClass();

	void Initialize(const Message& msg);
	void AddedToObject();
	bool Frame();

	void GetMouseLocation(int&, int&);

	bool IsPressedKey(unsigned char);

private:
	bool ReadKeyboard();
	bool ReadMouse();
	void ProcessInput();

private:
	IDirectInput8* m_directInput;
	IDirectInputDevice8* m_keyboard;
	IDirectInputDevice8* m_mouse;

	unsigned char m_keyboardState[256];
	DIMOUSESTATE m_mouseState;

	int m_screenWidth, m_screenHeight;
	int m_mouseX, m_mouseY;
};
